﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using DBO;
using ClientUtility;

namespace ClientUtility
{
    public class EntityFactory
    {
        public static Entity getEntity(string name)
        {
            Entity e = null;

            if (name == null || name == "")
                return null;

            switch (name.ToLower())
            {
                case "footman":
                    e = new Footman();
                    break;

                case "archer":
                    e = new Archer();
                    break;

                case "knight":
                    e = new Knight();
                    break;

                case "militian":
                    e = new Militian();
                    break;

                case "knife_thrower":
                    e = new KnifeThrower();
                    break;

                case "ranger":
                    e = new Ranger();
                    break;

                default:
                    throw new ClientException("Unknown entity : '" + name + "'.");
            }

            return e;
        }
    }
}
